﻿using System.Web.Http;
using FrameWork.Common;
using FrameWork.Common.Const;
using FrameWork.Entity.Model.Account;
using FrameWork.Entity.ViewModel;
using FrameWork.Entity.ViewModel.Account;
using FrameWork.Web;

namespace API.Areas.Account.Controllers
{
    public class AccountController : AdminControllerBase
    {
        [HttpPost]
        [Route("api/Account/Account/DemoMethod")]
        public object DemoMethod(DemoMethodRequest request)
        {
            var model = AccountService.DemoMethod(request);

            var viewModel = model.MapTo<DemoMethodViewModel, DemoMethodModel>();
            
            var result = new BaseViewModel
            {
                Info = viewModel,
                Message = CourseConst.SuccessStr,
                Msg = true,
                ResultCode = CourseConst.SuccessCode
            };
            return result.ToJsonForResp();
        }
    }
}